package com.gh.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gh.mapper.HouseResourcesMapper;
import com.gh.pojo.HouseResources;
import com.gh.service.HouseResourcesService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author Eric
 * @Date 2021/7/13 22:15
 * @Version 1.0
 */
@Service
@Transactional
public class HouseResourcesServiceImpl extends ServiceImpl<HouseResourcesMapper, HouseResources> implements HouseResourcesService {
    @Override
    public int saveHouseResources(HouseResources houseResources) {
        //添加校验
        if(StringUtils.isBlank(houseResources.getTitle())){
            return -1;
        }
        // 其他校验以及逻辑省略 ……
        return baseMapper.insert(houseResources);
    }
}
